package br.edu.utfpr.backupTools.view.action.backup;

import br.edu.utfpr.backupTools.model.pojo.Backup;
import br.edu.utfpr.backupTools.view.action.AbstractCommand;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarBackupLocal;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarBackupRemoto;
import br.edu.utfpr.comum.RetornoValidacao;

public class GerarTodosBackups extends AbstractCommand<Backup> {
	
	RetornoValidacao rv;
	
	@Override
	public RetornoValidacao execute(Backup bean) {
		gerarBackup = new GerarBackupLocal();
		rv = gerarBackup.gerarTodosBackups();

        if(!rv.isOk())
            return rv;

		gerarBackup = new GerarBackupRemoto();
		rv = gerarBackup.gerarTodosBackups();
		
		return rv;
	}

}
